package gruppoSoluzione.mainService.data;

import java.io.IOException;
import java.io.Writer;

/**
 * A {@link BufferedStringWriter} which stores strings by writing them as lines
 * on any java.io.Writer.
 * 
 * For example, it can be used to write files or to write on any web Stream
 * 
 * @author Alessandro Martinelli
 * 
 */
public class WriterStringWriter implements BufferedStringWriter {
	private Writer writer;

	public WriterStringWriter(Writer writer) {
		super();
		this.writer = writer;
	}

	@Override
	public void writeln(String message) throws IOException {
		writer.write(message + "\n");
	}
}
